package com.gitee.wsl.doc.prosemirror.model.node.ext

import com.gitee.wsl.doc.prosemirror.model.node.Node
import com.gitee.wsl.doc.prosemirror.model.node.NodeType

fun Node.canChangeType( pos: Int, type: NodeType): Boolean {
    val resolvedPos = resolve(pos)
    val index = resolvedPos.index()
    return resolvedPos.parent.canReplaceWith(index, index + 1, type)
}